﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Prodma.DataAccess.Models.UserControlViewModels.FindVm>" %>
<div class="listFindBarTitle">Arama :</div>
<div class="listFindBarText"><input type="text" id="find" name="find" class="listInput" /></div>
<a href='#' onclick="findList();">
    <img class="listFindBarButton" src="../../Images/ListImages/find.png" />
</a>

<% string url = "/" + ViewData.Model.View + "/index/?"; %>
<% if (ViewData.Model.Keys != null) %>
<% { %>
     <% for (int i = 0; i < ViewData.Model.Keys.Count; i++) %>
     <% { %>
          <% url += ViewData.Model.Keys[i] + "=" + ViewData.Model.Values[i] + "&"; %>
     <% } %>
<% } %>

<a href='<%=url %>'>
    <img class="listFindBarButton" src="../../Images/ListImages/all.png" />
</a>

<% url += "find=" + Request.Form["find"]; %>
<input type="hidden" id="pageName" name="pageName" value='<%=url %>' />

<script type="text/javascript">
    function findList() {
        var parameter = document.getElementById('find').value;
        var action = document.getElementById('pageName').value + document.getElementById('find').value;
        if (findValidate()) {
            document.location.replace(action);
        }
    }
</script>